import System( getArgs )
import Test

data Queue t = Queue [t] [t]

makeTup (Queue l r) = (l,r)

newQueue = Queue [] []

push x (Queue l r) = Queue l (x:r)

remove (Queue (x:l) r) = Queue l r
remove (Queue [] r) = remove (Queue (reverse r) [])

peek (Queue (x:l) r) = x
peek (Queue [] r) = peek (Queue (reverse r) [])


main = do args <- getArgs
          writeFile "result.dat" ("Queue 2 Results:" ++ "\n")
          writeFile "out.dat" "tmp:"
          --Test.multiTest push remove newQueue makeTup (rInt (head args)) (rInt (head (tail args)))
          --Test.multiTest push remove newQueue makeTup (rInt (head args)) (rInt (head (tail args)))
          --Test.pushPop push remove newQueue makeTup (rInt (head args))
          --Test.ppTest push remove newQueue makeTup (rInt (head args))
          let q = Queue [] [1..(rInt (head args))]
          --Test.removeTest remove q makeTup (rInt (head args)) (rInt (head (tail args))) 0
          --Test.pushTest push peek newQueue makeTup (rInt (head args)) (rInt (head (tail args))) 0
          --Test.pushremovenTest push remove newQueue makeTup (rInt (head args)) (rInt (head (tail args))) 0
          --Test.repeatTest push remove peek newQueue (push 1 newQueue) makeTup (rInt (head args)) (rInt (head (tail args))) 0
          Test.rrTest push remove peek (Test.pushntimes push newQueue (rInt (head (tail args)))) makeTup (rInt (head args)) (rInt (head (tail args))) 0